<template>
<div>
  <div class="fields-bottom-input">
    <p class="input-content">
      <i class="el-icon-upload2"></i>
			上传
		</p>
  </div>

  <div class="out-row">
    <div class="block-file" v-for="(item) in fieldsObj.settings.value" :key="item.uid">
      <i class="el-icon-document"></i>
      <span>{{item.name}}</span>
    </div>
  </div>
</div>
</template>

<script>
export default {
  name: 'CTimeRange',
  props: {
    fields: {
      default: () => {
        return {}
      },
    },
  },
  watch: {
    'fields': {
      handler (val) {
        this.fieldsObj = val
      },
      deep: true,
      immediate: true
    }
  },
  data () {
    return {
      fieldsObj: {}
    }
  },
  methods: {
    getTime (data, num) {
      return data && data.length ? data[num] : data
    }
  },
  mounted () {
    this.fieldsObj = this.fields
  }
}
</script>

<style lang="less" scoped>
.input-tips {
  color: #CBCFD6;
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

.fields-bottom-input {
    position: relative;
    flex: 1;
    // margin-right: 44px;
    margin-bottom: 16px;
    &:last-child {
      margin-right: 0;
    }
    .el-icon-date {
        position: absolute;
        right: 12px;
        top: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }
}
.out-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  .block-file {
    width: 228px;
    height: 32px;
    background: #FFFFFF;
    border-radius: 3px;
    border: 1px solid #DBDFEB;
    display: flex;
    align-items: center;
    margin-right: 32px;
    font-size: 14px;
    padding: 0 12px;
    flex: 1;
    &:last-child {
      margin-right: 0;
    }

    span {
      margin-left: 8px;
      flex: 1;
    }
  }
}
</style>
